import vars from '@/styles/vars.json'

interface IPermission {
  MESSAGE: boolean
  MY_CONSULT: boolean
  MY_QA: boolean
  DISTRIBUTION: boolean
  MEMBER_CODE: boolean
  USER_BEHAVIOR_TRACK: boolean
  KEFU: boolean
  LANGUAGE: boolean
  CONTACT_US: boolean
  DISCOUNT_CODE: boolean
  POPULARITY: boolean
  CMS_API_COMMON: boolean
  SEARCH_O2O_B2C_SHOW: boolean
  WX_TAB_BAR: boolean
}

const FNS: IPermission = {
  MESSAGE: true, // 消息入口
  MY_CONSULT: true, // 我的咨询
  MY_QA: true, // 我的问答
  DISTRIBUTION: true, // 分销中心
  MEMBER_CODE: true, // 会员码
  USER_BEHAVIOR_TRACK: true, // 埋点
  KEFU: true, // 客服
  LANGUAGE: false, // 语言设置
  CONTACT_US: false, //联系我们
  DISCOUNT_CODE: false, // 优惠码
  POPULARITY: false, // 人气值
  CMS_API_COMMON: false, // cms请求修改成common
  SEARCH_O2O_B2C_SHOW: true, // 搜索是否显示o2o和b2c
  WX_TAB_BAR: process.env.VUE_APP_WX_TAB_BAR === 'true', // 是否使用原生微信底部导航
}

const COMMIT: any = {}

// 生成环境判断
if (process.env.NODE_ENV === 'production') {
  // 更新commit信息
  COMMIT.COMMIT_ID = process.env.VUE_APP_COMMIT_ID
  COMMIT.CURRENT_BRANCH = process.env.VUE_APP_CURRENT_BRANCH
  COMMIT.COMMIT_DETAIL = process.env.VUE_APP_COMMIT_DETAIL
  COMMIT.BUILD_TIME = process.env.VUE_APP_BUILD_TIME
}

export default {
  COMMIT,
  FNS,
  css: vars,
  appid: 'wx5d43219c9c78c909', //微信公众号appid
  appletAppId: 'wxbd9ca0fd88e1cbbd', //微信小程序appid
}
